#ifndef AST_DECLARATIONS_SPECIFIER_QUALIFIER_LIST_H
#define AST_DECLARATIONS_SPECIFIER_QUALIFIER_LIST_H

#include "../ASTNode.h"


class TypeSpecifier;
class TypeQualifier;

/*
C99  6.7.2.1
specifier-qualifier-list:
		type-specifier    specifier-qualifier-list(opt)
		type-qualifier    specifier-qualifier-list(opt)
*/
class SpecifierQualifierList : public ASTNode
{
public:
	enum {
		type_specifier,
		type_qualifier,
	};
protected:
	SpecifierQualifierList(void)
		: ASTNode(ASTNode::specifier_qualifier_list){};
public:
	SpecifierQualifierList(TypeSpecifier *pTSpec, SpecifierQualifierList *pSpecQualList = NULL)
		: ASTNode(ASTNode::specifier_qualifier_list)
		, m_iType(type_specifier)
		, m_pSpecQualList(pSpecQualList)
		, m_pTSpecifier(pTSpec){};
	SpecifierQualifierList(TypeQualifier *pTQual, SpecifierQualifierList *pSepcQualList = NULL)
		: ASTNode(ASTNode::specifier_qualifier_list)
		, m_iType(type_qualifier)
		, m_pSpecQualList(pSepcQualList)
		, m_pTQualifier(pTQual){};


	virtual ~SpecifierQualifierList(void);

	virtual void						codeGen();

protected:
	tiny_int							m_iType;
	SpecifierQualifierList *				m_pSpecQualList;		//may be NULL
	union{
		TypeQualifier *					m_pTQualifier;
		TypeSpecifier *						m_pTSpecifier;
	};
};


#endif


